namespace Warehouse

open System.Windows.Data
open FSharp.Windows
open Warehouse.Controls

type EMailEvents = 
    | Send of (unit -> unit)

type EMailView() = 
    inherit View<EMailEvents, EMailModel, EMailWindow>()
    
    override this.EventStreams = 
        [
            this.Control.Send.ClickToValue(Send this.OK)
        ] 


    override this.SetBindings model =
        Binding.FromExpression 
            <@
                this.Control.Recipient.Text <- model.Recipient
                this.Control.Subject.Text <- model.Subject
                this.Control.Body.Text <- model.Body
            @>        
            
